import numpy as ny
import pandas as pd

data_frame = pd.DataFrame(ny.random.randint(1, 10, (3, 4)), index=list('abc'), columns=list('ABCD'))
print(data_frame)

# 指定列运算
print(data_frame['B'] + 3)
print(data_frame['B'].add(3))

# 使用add方法可实现后续的链式编程
print(data_frame['B'].add(3).head(2))

# 全量列运算
print(data_frame + 3)
